#include "task_test.h"
#include "app_main.h"
void task_print(void * pvParameters)
{
	char *pcTaskName;
	volatile unsigned long ul;
	static portTickType xLastWakeTime;
	
	pcTaskName = (char *)pvParameters;
	for(;;)
	{

		printf(pcTaskName);

		vTaskDelay(250);
		printf("ulIdelCycleCount = %d \n",ulIdelCycleCount);
	
	}
}
void task_print1(void * pvParameters)
{
	char *pcTaskName;
	volatile unsigned long ul;
	static portTickType xLastWakeTime;
	unsigned portBASE_TYPE uxPriority;
	
	pcTaskName = (char *)pvParameters;
	uxPriority = uxTaskPriorityGet(NULL);
	xTaskCreate(task3_delete,"Task2",configMINIMAL_STACK_SIZE * 5,(void *)pcTextForTask2,2,&xTask2Handle);
	for(;;)
	{

		printf("Task1 is running");
		
		printf("next \n \n \n");
		vTaskDelay(250);
//		vTaskPrioritySet(xTask2Handle,uxPriority+1);
//		vTaskDelay(250);
//	for(ul=0;ul<15000000;)
//	{
//		ul++;
//	}

	}
}
void task3_delete(void *pvParameters)
{
	printf("hello Task3! \n");
	vTaskDelete(xTask3Handle);
}
void task_print2(void * pvParameters)
{
	char *pcTaskName;
	volatile unsigned long ul;
	static portTickType xLastWakeTime;
	unsigned portBASE_TYPE uxPriority;
	uxPriority = uxTaskPriorityGet(NULL);
	
	pcTaskName = (char *)pvParameters;
	for(;;)
	{

		printf(pcTaskName);

		

		printf("return to  \n \n");
		vTaskPrioritySet(NULL,(uxPriority -2 ));
	//	for(ul=0;ul<15000000;)
	//	{
	//		ul++;
	//	}

		
	//	vTaskDelay(250);
		

	}
}

